package {

	/**
	 * @author Andkrup
	 * 
	 * Contains functionality that extends the standard Math functions where
	 * degrees are useful instead of radians.
	 * 
	 * Very much inspired by Robert Penners Math functions
	 */
	public class MathD {
		public static function tan(x:Number):Number{
			return Math.tan(x * (Math.PI / 180));
		}
		public static function atan2(x:Number, y:Number):Number{
			return Math.atan2(x, y) * (180 / Math.PI);
		}
		public static function cos(x:Number):Number{
			return Math.cos(x * (Math.PI / 180));
		}
		public static function acos(x:Number):Number{
			return Math.acos(x) * (180 / Math.PI);
		}
		public static function sin(x:Number):Number{
			return Math.sin(x * (Math.PI / 180));
		}
		public static function asin(x:Number):Number{
			return Math.asin(x) * (180 / Math.PI);
		}
	}
}
